
package com.ruifu.common.feign;

import com.fhzncloud.cloud.common.core.constant.SecurityConstants;
import com.ruifu.common.constant.BizServiceNameConstants;
import com.ruifu.common.feign.factory.RemoteDocServiceFallbackFactory;
import com.ruifu.common.po.DmDocVer;
import com.ruifu.common.vo.worksheet.WsCommonSheet;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(contextId = "remoteDocService", value = BizServiceNameConstants.DOC_SERVICE, fallbackFactory = RemoteDocServiceFallbackFactory.class)
public interface RemoteDocService {

	/**
	 * 文档详情
	 *
	 * @param dvDvId
	 * @return
	 */
	@GetMapping(value = "/feignDoc/feignFindByIdDoc/{dvDvId}")
	DmDocVer feignFindByIdDoc(@PathVariable("dvDvId") Long dvDvId);

	/**
	 * 文档修改
	 *
	 * @param dmDocVer
	 * @return
	 */
	@PostMapping(value = "/feignDoc/feignUpdateDoc")
	Integer feignUpdateDoc(@RequestBody DmDocVer dmDocVer);

	/**
	 * 文档权限初始化
	 * @param sourceTenantId
	 * @param newTenantId
	 * @return
	 */
	@GetMapping("/feignDoc/feignCopyPermission/{sourceTenantId}/{newTenantId}")
	Boolean feignCopyPermission(@PathVariable("sourceTenantId") Integer sourceTenantId,
								@PathVariable("newTenantId") Integer newTenantId,@RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 文档类型初始化
	 * @param sourceTenantId
	 * @param newTenantId
	 * @return
	 */
	@GetMapping("/feignDoc/feignCopyDocType/{sourceTenantId}/{newTenantId}")
	Boolean feignCopyDocType(@PathVariable("sourceTenantId") Integer sourceTenantId,
								 @PathVariable("newTenantId") Integer newTenantId,@RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 工作单权限
	 * @param wsCommonSheet
	 * @return
	 */
	@PostMapping("/feignDoc/feignWorkFormPermissions")
	String feignWorkFormPermissions(@RequestBody WsCommonSheet wsCommonSheet);

}